package com.tongji.housediy.view
{
	/**
	 * 
	 * @author xuxunjia
	 * 
	 */	
	
	import mx.events.ColorPickerEvent;
	import mx.events.DropdownEvent;
	
	import org.robotlegs.mvcs.Mediator;
	
	public class ColorPickerMediator extends Mediator
	{
		[Inject]
		public var view:ColorPickerBtn;
		
		override public function onRegister():void
		{
			view.addEventListener(DropdownEvent.CLOSE, colorPickerClose);
		}
		
		private function colorPickerClose(event:DropdownEvent):void
		{
			view.stage.focus = null;
			dispatch(new ColorPickerEvent(ColorPickerEvent.CHANGE, false, false, view.selectedIndex, view.selectedColor));
		}
		
	}
}